      SUBROUTINE GRDFCE(ETA)
C
      IMPLICIT REAL*8 (A-H,O-Z)
C
C     SUBROUTINE  GRDFCE  IS THE SUBROUTINE WHICH COMPUTES THE
C     GRAVITATIONAL FORCES ADDED ALONG THE BODY FRAME AXES
C     FOR FSD GROUND TESTING SIMULATION OF THE FLEXIBLE APPENDAGES.
C     IT IS WRITTEN AND CODED BY K. YONG OF COMPUTER SCIENCES CORP.
C     IN MARCH 1976
C
C     EXISTING FSD COMMON BLOCKS
C
      COMMON/CSTVAL/TSTART,ZL0(10),ZL1(10),ZL2(10),ZLA(10)
C
      COMMON/RPOOL1/RHOK(10),TIME,SA(3,3),FM1(3,3),ZLK(10),
     *              OMEG(3),ZLKP(10),ZLKDP(10),CMAT(3),GBAR(3,3),
     *              YBCM(3),ZBZK(3,10),FCM(3,3),DTO,PHID,PHI
C
      COMMON/RPOOL3/ZMS,YIZM(3,2)
C
C     NEW COMMON BLOCKS ADDED TO FSD
C
      COMMON/GRNTST/ALFAEG,DELTAG,PHASEG,ALTUDE,OMGY(3),
     *              GACC(3),GLOCAT(3),IGRUND,IALTUD,IGASBR
C
      COMMON/GMATRX/GMAX(3,3),GMAXT(3,3)
C
      DIMENSION ETA(7),GFOC(3),GMOM(3),DUMY(3)
C
C     COMPUTE GRAVITATIONAL FORCES IN THE BODY FRAME
C
      IF(TIME.LT.TSTART) GO TO 20
      DO 57 I=1,3
      DO 57 J=1,3
 57   GMAXT(I,J)=SA(J,I)
      CALL DMATVC(GMAXT,GACC,DUMY)
      DO 10 I=1,3
      GFOC(I)= ZMS*DUMY(I)
 10   CONTINUE
C
C     COMPUTE THE MOMENT IF THE ACTING FORCE IS NOT AT THE BODY
C     FRAME ORIGIN
C
      GMOM(1)= GLOCAT(2)*GFOC(3) - GLOCAT(3)*GFOC(2)
      GMOM(2)= GLOCAT(3)*GFOC(1) - GLOCAT(1)*GFOC(3)
      GMOM(3)= GLOCAT(1)*GFOC(2) - GLOCAT(2)*GFOC(1)
C
C     ADD FORCE AND MOMENT DUE TO GROUND GRAVITATIONAL
C     INFLUENCE ON THE REDUCED SYSTEM FORCING FUNCTIONS
C
      DO 20 I=1,3
      I1=I+3
      ETA(I)= ETA(I)+ GFOC(I)
      ETA(I1)= ETA(I1) +GMOM(I)
 20   CONTINUE
      RETURN
      END
